# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Firestore.V1.Model.GoogleFirestoreAdminV1Backup do
  @moduledoc """
  A Backup of a Cloud Firestore Database. The backup contains all documents and index configurations for the given database at a specific point in time.

  ## Attributes

  *   `database` (*type:* `String.t`, *default:* `nil`) - Output only. Name of the Firestore database that the backup is from. Format is `projects/{project}/databases/{database}`.
  *   `databaseUid` (*type:* `String.t`, *default:* `nil`) - Output only. The system-generated UUID4 for the Firestore database that the backup is from.
  *   `expireTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp at which this backup expires.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The unique resource name of the Backup. Format is `projects/{project}/locations/{location}/backups/{backup}`.
  *   `snapshotTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The backup contains an externally consistent copy of the database at this time.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the backup.
  *   `stats` (*type:* `GoogleApi.Firestore.V1.Model.GoogleFirestoreAdminV1Stats.t`, *default:* `nil`) - Output only. Statistics about the backup. This data only becomes available after the backup is fully materialized to secondary storage. This field will be empty till then.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :database => String.t() | nil,
          :databaseUid => String.t() | nil,
          :expireTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :snapshotTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :stats => GoogleApi.Firestore.V1.Model.GoogleFirestoreAdminV1Stats.t() | nil
        }

  field(:database)
  field(:databaseUid)
  field(:expireTime, as: DateTime)
  field(:name)
  field(:snapshotTime, as: DateTime)
  field(:state)
  field(:stats, as: GoogleApi.Firestore.V1.Model.GoogleFirestoreAdminV1Stats)
end

defimpl Poison.Decoder, for: GoogleApi.Firestore.V1.Model.GoogleFirestoreAdminV1Backup do
  def decode(value, options) do
    GoogleApi.Firestore.V1.Model.GoogleFirestoreAdminV1Backup.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Firestore.V1.Model.GoogleFirestoreAdminV1Backup do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
